package com.yjd.comm.asynmsg.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yjd.comm.asynmsg.dao.ITaskMsgProcessDataDao;
import com.yjd.comm.asynmsg.model.TaskMsgProcessDataModel;
import com.yjd.comm.asynmsg.service.ITaskMsgProcessDataService;
import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;

/**
 * <b>description</b>：任务消息处理记录业务实现<br>
 * <b>time</b>：2015-01-26 17:02:57 <br>
 * <b>author</b>： ready likun_557@163.com
 */
@Service("taskMsgProcessDataService")
public class TaskMsgProcessDataServiceImpl extends BaseServiceImpl implements
		ITaskMsgProcessDataService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public TaskMsgProcessDataModel insert(TaskMsgProcessDataModel model)
			throws Exception {
		return this.taskMsgProcessDataDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(TaskMsgProcessDataModel model) throws Exception {
		return this.taskMsgProcessDataDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("id", id);
		return this.taskMsgProcessDataDao.deleteModel(paramMap, true);
	}

	@Resource
	private ITaskMsgProcessDataDao taskMsgProcessDataDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.taskMsgProcessDataDao;
	}

}
